package cn.com.cdb.ldms.components.threadpools;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@Data
@ConfigurationProperties(prefix = "thread-pools")
public class ThreadPoolProperties {
    private Map<String, ThreadPoolConfig> configs = new HashMap<>();

    @Data
    public static class ThreadPoolConfig {
        private int corePoolSize = 8;
        private int maxPoolSize = 16;
        private int queueCapacity = 100;
        private int keepAliveSeconds = 60;
        private String threadNamePrefix;
        private String rejectedExecutionHandler = "CallerRunsPolicy";
    }
}